#include<iostream>
#include<cstring>
using namespace std;
//int arr[100];
//int brr[100];
//int crr[100];
//int drr[100] = { '~','!','@','#','$','%','^' };
int main()
{
	/*int z = 0; 
	for (int i = 'a'; i < 'a' + 26; i++)
	{
		arr[z++] = i;
	}
	z = 0;
	for (int i = 'A'; i < 'A' + 26; i++)
	{
		brr[z++] = i;
	}
	z = 0;
	for (int i = '0'; i < '0' + 9; i++)
	{
		crr[z++] = i;
	}*/
	char arr[] = "abcdefghijklmnopqrstuvwxyz";
	char brr[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	char crr[] = "0123456789";
	char drr[] = "~!@#$%^";
	int n;
	cin >> n;
	char a[1001];
	getchar();
	while (n--)
	{
		cin >> a;
		int count = 0;
		int len = strlen(a);
		if (len >= 8 && len < 16)
		{
			int flag = 1;
			for (int i = 0; i < len; i++)
			{
				char* p;
				if (p=strstr(arr,))
				{
					
				}
			}
		}
		else
		{
			cout << "NO" << endl;
		}
	}
	return 0;
}